package com.geeklan.smart.ui.dialog;

import android.content.Context;
import android.view.LayoutInflater;

import com.geeklan.smart.R;
import com.geeklan.smart.databinding.DialogContentSmartFoodBinding;
import com.geeklan.smart.databinding.LayoutSelectPetWeightBinding;
import com.geeklan.smart.utils.DensityUtils;

public class PetWeightBottomSheetDialog extends BaseBottomSheetDialog<LayoutSelectPetWeightBinding> {
    public PetWeightBottomSheetDialog(Context context) {
        super(context);
    }

    @Override
    protected LayoutSelectPetWeightBinding createContentViewBinding(LayoutInflater inflater) {
        return LayoutSelectPetWeightBinding.inflate(inflater);
    }

    @Override
    protected void setupDialog() {
        super.setupDialog();
        setConfirmButtonVisible(true);
        setDialogTitle(R.string.pet_edit);
        setNonFullScreen(0.45f);
//        setContentViewHeight(DensityUtils.dpToPx(mContext,com.smart.base.R.dimen.dp_250));
        setConfirmButtonClickListener(v -> {
            dismiss();
            onBackListener.callback(mBinding.horizontalRuler.getSelectedValue());
        });
    }

    private OnBackListener onBackListener;

    public void setOnBackListener(OnBackListener onBackListener) {
        this.onBackListener = onBackListener;
    }

    public interface OnBackListener {
        void callback(float weight);
    }
}
